package dominio.xml;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import dominio.beans.Cliente;
import dominio.beans.OrdenDePedido;
import dominio.beans.Producto;
import dominioSets.srv.SetListaOrdenesDePedido;

public class OrdenDePedidoXML {

	static XStream xStream;

	static{
		xStream = new XStream(new DomDriver());
		
	}
	
	public void pasarAXml (SetListaOrdenesDePedido odp)
	{
		xStream.alias("OrdenDePedido",OrdenDePedido.class);
		xStream.alias("Cliente",Cliente.class);
		xStream.alias("Rodamientos",Producto.class);
		xStream.toXML(odp);
	}
	
	public SetListaOrdenesDePedido obtenerOrden(){
		SetListaOrdenesDePedido pedidos;
		pedidos = (SetListaOrdenesDePedido) xStream.fromXML("OrdenesDePedido");
		return pedidos;
	}
	
	
}
